XI2: translate group state back into core state
authorMatthias Clasen <mclasen@redhat.com>
Sat, 5 Feb 2011 02:08:41 +0000 (21:08 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 5 Feb 2011 02:11:40 +0000 (21:11 -0500)
This is necessary to make the key event translation work
as expected.

https://bugzilla.gnome.org/show_bug.cgi?id=641367

gdk/x11/gdkdevice-xi2.c

index a3700de7578de4a2fe39cb2fac28a107839cd97b..4b718102ba68a5bd5c3a56cbcd82902f42a9d373 100644 (file)
@@ -728,5 +728,17 @@ _gdk_x11_device_xi2_translate_state (XIModifierState *mods_state,
         }
     }
 
+  if (group_state)
+    {
+      gint group;
+
+      group = group_state->base + group_state->latched + group_state->locked;
+
+      /* FIXME: do we need the XKB complications for this ? */
+      group = CLAMP(group, 0, 3);
+
+      state |= group << 13;
+    }
+
   return state;
 }